use core::behavior_tree::BehaviorTree;
use core::blackboard::Blackboard;
use core::base_node::{NodeData, BaseNode};

pub struct Tick<'a> {
    pub tree: &'a mut BehaviorTree,
    pub blackboard: &'a mut Blackboard,
    pub node_count: u32,
    pub open_nodes: Vec<NodeData<BaseNode>>
}
impl<'a> Tick<'a> {
    pub fn new(tree_ref: &'a mut BehaviorTree, blackboard_ref: &'a mut Blackboard) -> Tick<'a>{
        Tick {
            tree: tree_ref,
            blackboard: blackboard_ref,
            node_count: 0,
            open_nodes: Vec::new()
        }
    }
    pub fn enter_node(&mut self, node: NodeData<BaseNode>) {
        self.node_count = self.node_count + 1;
        self.open_nodes.push(node);
    }
    pub fn open_node(&mut self, _node: NodeData<BaseNode>) {}
    pub fn tick_node(&mut self, _node: NodeData<BaseNode>) {}
    pub fn exit_node(&mut self, _node: NodeData<BaseNode>) {}
    pub fn close_node(&mut self, _node: NodeData<BaseNode>) {
        self.open_nodes.pop();
    }
}